#pragma once
#include "listeners.h"
 
struct CallRequest
{
	size_t fromFloor;
	bool upDirection;
	CallRequest(size_t floorToCall, bool goingUp) : fromFloor(floorToCall), upDirection(goingUp) {};
};

class CFloor;
typedef std::vector<CFloor*> FloorsCollection;

class CFloor
{
public:
	CFloor(size_t floorNum);
	~CFloor(void);
	void ElevatorArrived();
	void RegisterListeners(ILoadPassengersListener* loadPassengerslistener, ICallRequestListener* callRequestListener);

	void CallElevator(bool goingUp); //something from above is going to call an elevator here
	void AddIncomingPassengers(const PassengerCollection& incomingPassengers);
	size_t GetNum() const { return m_floorNum; };
private:
	size_t m_floorNum;
	PassengerCollection m_incomingPassengers;

	ILoadPassengersListener *m_elevatorArrivedListener;
	ICallRequestListener *m_callRequestlistener;
};
